(please sit in your project groups!)
Today we will…
A process of tracking changes to a file or set of files over time so that you can recall specific versions later.
GitHub makes it easy to have multiple people working on the same files at the same time.
You can host a URL of fun things (like the class text, these slides, a personal website, etc.) with GitHub pages.
Git is based on repositories.
.gitignoreSometimes there are files that you do not want to track.
.gitignore file specifies the files that git should intentionally ignore./bin, .DS_Store) or files/directories that you do not want to be shared (e.g., solutions/)..Rproj files!Create an exact copy of a remote repo on your local machine.
Tell git you have made changes you want to add to the repo.
The red line is a change we commit (add) to the repo.
The log of these changes (and the file history) is called your git commit history.
Update the copy of your repo on GitHub so it has the most recent changes you’ve made on your machine.
Update the local copy of your repo (the copy on your computer) with the version on GitHub.
When you have an existing local repo:
These occur when git encounters conflicting changes.
We will work on resolving merge conflicts today!
R PackagesWork in your console or an Rscript for this.
usethis package.gitcreds Package.(Nothing should happen.)
Generate Token.When prompted to Enter password or token:, paste your PAT.
Collaborating within a GitHub Repo
Designate each person one of the suits:
You will reference these as you work through the activity.
Warning
If you only have 3 group members here, assign one person both and
.
Please put up your sticky note to indicate your group is ready to move on!
Repositories > New
stat331-PA6.gitignore template: RSettings > Collaborators > Add people
View invite > Accept invite
File > New Project > Version Control > Git<> Code and copy the HTTPS address.Repository URL.Browse and create this new project on your desktop.
Create ProjectPA6.qmd in your new stat331-PA6 folder.self-contained: true to the YAML..gitignore file to include *.Rproj.Git pane > Commit
.gitignore, add a commit message (“ignore all .Rproj files”), click Commit, click Close.PA6.qmd and PA6.html, add a commit message (“create PA quarto file”), click Commit, click Close.Git pane > Push the changes to the remote repo.
Git pane > Pull the changes that were made!Everyone should now have the .qmd and .html files in their local repo!
Files pane.author: to the YAML and include everyone’s first names.Git pane > Commit > Stage (checkmark) files > add commit message > Commit
Git pane > Push the changes.
Do not pull the changes that were made!
author: to the YAML and include everyone’s first and last names.Git pane > Commit > Stage (checkmark) files > add commit message > Commit
Git pane > Push the changes.You got an error! Ugh. We forgot to pull before we started making changes.
Rstudio: Git pane > Pull the changes from the repo.
If your Git Pull window does not look like this:
git config pull.rebase false ) into the Terminal pane and hit Enter.Pull again.Tip
Note how the conflicting lines are marked! You might need to submit this to Canvas…
.qmd file to resolve the conflict with the preferred change. Render.Commit your changes.Push your changes to GitHub.
Do not pull the changes that were made!
Commit your changes and Push your changes to GitHub.Warning
You will get an error, read it and Pull.
Push your changes again.Note: your merge may have been made by a different strategy. That’s okay!
Do not pull the changes that were made!
Commit your changes and Push your changes to GitHub.Warning
You will get an error. Ugh!!!! We forgot to pull again!
Pull the changes from the repo..qmd file to resolve the conflict with the preferred change.Commit your changes and Push your changes to GitHub.
Pull the changes and look at your final document.
How does Git mark the start of lines with a merge conflict?
Burn your local repo to the ground and clone again.
Note
Extended office hours on Tuesday from 10:00 - 12:00. No office hours on Friday.
Please grab separators from the sides of the room as you enter.
I will pass out a hard copy of the exam.
Canvas will unlock the .qmd template at the beginning of class.
Section 1: General Questions
Section 2: Short Answer
.qmd template from Canvas..qmd and .html files on Canvas by the end of class.Section 3: Open-Ended Analysis
.qmd file..qmd and .html file 24-hours after the end of class.